package com.tuling;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class DubboConsumerDemo {

    //stub指定本地存根方法
    @Reference(version = "default", stub = "com.tuling.DemoServiceStub")
    private DemoService demoService;

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DubboConsumerDemo.class);
        DemoService demoService = context.getBean(DemoService.class);
        System.out.println("1.开始执行sayHello");

        System.out.println((demoService.sayHello("你好")));
        System.out.println("6.执行sayHello结束");
    }

}
